﻿<UserControl x:Class="Sautom.Modules.Authorization.Views.Login"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:l="clr-namespace:Sautom.ClientComunication.Converters;assembly=Sautom.ClientComunication" 
             xmlns:res="clr-namespace:Sautom.I18N;assembly=Sautom.I18N" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <l:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
    </UserControl.Resources>    
    <StackPanel Width="300">
        <Label Content="{Binding Source={x:Static res:AuthorizationResources.UserNameLabel}}" />
        <TextBox Text="{Binding UserName}" />
        <Label Content="{Binding Source={x:Static res:AuthorizationResources.PasswordLabel}}" />
        <DockPanel>
            <TextBox Text="{Binding Password}" Width="173" Height="21" />
            <Button DockPanel.Dock="Right" Content="{Binding Source={x:Static res:AuthorizationResources.ChangePasswordBtn}}" Command="{Binding ToChangePasswordCommand}" Height="24" Width="120" />
        </DockPanel>        
    	<Button Content="{Binding Source={x:Static res:AuthorizationResources.ProccessLoginBtn}}" Margin="0,10,0,0" Command="{Binding ProccessLoginCommand}" />
        <TextBlock TextWrapping="Wrap" Foreground="Red" Text="{Binding Source={x:Static res:AuthorizationResources.LoginErrorText}}" Margin="0,10,0,0" Visibility="{Binding HasError, Converter={StaticResource BoolToVisibilityConverter}}" />
    </StackPanel>
</UserControl>
